<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <!--标准mui.css-->
    <link rel="stylesheet" href="../static/weixinKp/css/mui.min.css">
    <!--App自定义的css-->
    <link rel="stylesheet" type="text/css" href="../static/weixinKp/css/main.css" />
    <title>注册公司 </title>
    <style>
    </style>
</head>

<body>
    <div class="wrap">
        <div class="deleDetail" style="display:block">
            <div class="deleInfo">
                <div class="left"><span class="red">*</span>所在地区</div>
                <div class="right" id="area"><input type="text" value='' placeholder="请选择所在地区" readonly class="number" id="city"><img src="./images/right.png" alt="" class="icon-right"></div>
            </div>
            <div class="deleInfo">
                <div class="left"><span class="red">*</span>所属行业</div>
                <div class="right" id="entrust"><input type="text" value='' placeholder="请输入所属行业" class="number" id="industry"></div>
            </div>
            <div class="deleInfo">
                <div class="left"><span class="red">*</span>公司名称</div>
                <div class="right"><input type="text" value='' class="number" id="company" placeholder="请输入公司名称"></div>
            </div>
            <div class="deleInfo">
                <div class="left"><span class="red">*</span>联系人</div>
                <div class="right"><input type="text" value='' class="number" id="contacter" placeholder="请输入联系人"></div>
            </div>
            <div class="deleInfo">
                <div class="left"><span class="red">*</span>联系电话</div>
                <div class="right"><input type="text" value='' class="number" id="contactphone" maxlength="11" placeholder="请输入联系电话"></div>
            </div>
            <!-- <div class="deleInfo">
                <div class="left"><span class="red">*</span>联系地址</div>
                <div class="right"><textarea name="name" class="account_area" id="registeraddress"></textarea></div>
            </div> -->

        </div>
    </div>
    <footer class="footer">
        提交申请
    </footer>
    <!-- 第一层 -->
    <div class="big">
        <div class="anit_rigth">

        </div>
    </div>
    <script src="../static/weixinKp/js/mui.min.js"></script>
    <script src="../static/weixinKp/js/jquery-3.2.1.min.js" charset="utf-8"></script>
    <script src="../static/weixinKp/js/path.js" charset="utf-8"></script>
    <script type="text/javascript">
        $("#area").click(function() {
            window.location.href = "./city.html?id=" + 2;
        })
        var city = decodeURI(getQueryString('city'));
        if (city) {
            $("#city").val(city);
        }
        // 提交
        $(".footer").click(() => {
            var company = $("#company").val();
            var contacter = $("#contacter").val();
            var contactphone = $("#contactphone").val();
            var city = $("#city").val();
            var industry = $("#industry").val();
            // var registeraddress = $('#registeraddress').val();
            if (company && contacter && contactphone && city && industry){
                $.ajax({
                    url: path + '/app/registerCompany/submit',
                    dataType: 'json',
                    type: 'post',
                    xhrFields: {
                        withCredentials: true
                    },
                    data: {
                        company: company,
                        contacter: 　contacter,
                        contactphone: contactphone,
                        city: city,
                        industryname: industry,
                        // reporttaxtype : reporttaxtype
                    },
                    success: (data) => {
                        if (data.success == 1) {
                            mui.alert(data.message, function() {
                                window.location.href = './index.html';
                            })
                        }
                    },
                    error: (err) => {
                        mui.alert(err.message);
                    }
                })
            }else{
                if(city==''){
                    mui.alert('请选择所在地区！');
                    return;
                }
                if(industry==''){
                    mui.alert('请输入所属行业！');
                    return;
                }
                if(company==''){
                    mui.alert('请输入公司名称！');
                    return;
                }
                if(contacter==''){
                    mui.alert('请输入联系人！');
                    return;
                }
                if(contactphone==''){
                    mui.alert('请输入联系电话！');
                    return;
                }
            }
        })
    </script>
</body>

</html>
